package com.lagou.filter;

import javax.servlet.*;
import java.io.IOException;

public class LifecycleFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("LifecycleFilter对象创建了...执行了init方法");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.out.println("LifecycleFilter对象拦截了请求...执行了doFilter方法");
        chain.doFilter(request, response);
    }

    @Override
    public void destroy() {
        System.out.println("LifecycleFilter对象销毁了...执行了destroy方法");
    }
}
